package com.wuze.cloud.dao;

import com.wuze.cloud.model.SysRegisterData;
import com.wuze.cloud.pojo.SysUserDO;
import com.wuze.cloud.request.SysUserQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author: wuze
 * @description:
 * @date: 2023/02/16
 */
@Repository
public interface SysUserDao {


    //========读接口=========
    SysUserDO findByUserName(@Param("userName") String userName, @Param("state") String state);

    SysUserDO findByPhone(@Param("phone") String phone, @Param("state") String state);

    Integer count(@Param("query") SysUserQuery query, @Param("state") String state);

    Integer countAdmin(@Param("query") SysUserQuery query);
    List<SysUserDO> findByPage(@Param("query") SysUserQuery query, @Param("state") String state);

    List<SysUserDO> findByPageAdmin(@Param("query") SysUserQuery query);
    SysUserDO findById(@Param("id") Long id , @Param("state") String state);
    SysUserDO findByIdV2(@Param("id") Long id);
    List<SysUserDO> findByName(@Param("name") String userName);

    SysUserDO findByEmail(@Param("email")String email);

    List<SysRegisterData> getRegisterData(@Param("role") String role);

    //===========写接口=============
    void addSysUser(@Param("userDO") SysUserDO userDO);

    void updateUserInfo(@Param("userDO") SysUserDO userDO);

    void updateStateByIds(@Param("ids") List<Long> ids, @Param("state") String state);
}
